package jerry.html.data;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

/**
 * Enum to segregate stuff type
 * 
 * @author (h0t@_G0|i
 */
public enum StuffType {
	WEAPON("weapons"), ENHANCEMENT("enhancements"), PICKUP("pickups"), SPECIAL(null);
	
	public StuffType getStuffType(String stuff) {
		try {
			if(mytype != null)
				mytype.getString(stuff);
			else
				return null;
		} catch (MissingResourceException e) {
			return null;
		}
		return this;
	}
	private ResourceBundle mytype; 
	private StuffType(String logName) {
		if(logName != null) {
			mytype = ResourceBundle.getBundle(logName);
		}
	}
	/**
	 * @param stuffName
	 * @return
	 */
	public String convert(String stuffName) {
		return this.mytype!=null?mytype.getString(stuffName):stuffName;
	}
}
